import json

numbers = [12,23,1,2,4,2]

# json.dump()用于存储
filename = 'numbers.json'
with open(filename, 'w') as obj:
    json.dump(numbers, obj)